//
//  GKNovelChapter.swift
//  MySwiftObject
//
//  Created by wangws1990 on 2019/9/10.
//  Copyright © 2019 wangws1990. All rights reserved.
//

import UIKit
import HandyJSON
class GKNovelChapter: HandyJSON {
    var bookId:String!;
    var chapterId:String!;
    var chapterCover:String!;
    var link:String!;
    var time:String!;
    var title:String!;
    
    var isVip:Bool!;
    
    var order:Int!;
    var chapterIndex:Int!;
    var partsize:Int!;
    var totalpage:Int!;
    var currency:Int!;
    
    required init() {}
    func mapping(mapper: HelpingMapper) {
        mapper <<<
            self.chapterId <-- "id"
    }
    
    func getContent()->GKNovelContent{
        let info = BaseNetCache.memoryObject(forKey: self.chapterId);
        if info is GKNovelContent {
            return info as! GKNovelContent;
        }
        return GKNovelContent.init();
    }
}

class GKNovelChapterInfo: BaseModel {
    var _id:String!;
    var source:String!;
    var updated:String!;
    var book:String!;
    var starting:String!;
    var link:String!;
    var host:String!;
    var name:String!;
    
    var chapters:[GKNovelChapter]!;
}
